<!DOCTYPE html>
<!-- saved from url=(0052)http://getbootstrap.com/docs/4.0/examples/dashboard/ -->
<html lang="en" xmlns:th="http://www.thymeleaf.org"  xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
	<head>

		<title>添加学生</title>
		<!-- Bootstrap core CSS -->
		<link href="../static/asserts/css/bootstrap.min.css" th:href="@{/asserts/css/bootstrap.min.css}" rel="stylesheet">
		<!-- Custom styles for this template -->
		<link href="../static/asserts/css/dashboard.css" th:href="@{/asserts/css/dashboard.css}" rel="stylesheet">
		<style type="text/css">
			/* Chart.js */
			
			@-webkit-keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			@keyframes chartjs-render-animation {
				from {
					opacity: 0.99
				}
				to {
					opacity: 1
				}
			}
			
			.chartjs-render-monitor {
				-webkit-animation: chartjs-render-animation 0.001s;
				animation: chartjs-render-animation 0.001s;
			}
		</style>
	</head>

	<body>
<div th:replace="sidbar::#topbar"></div>

		<div class="container-fluid">
			<div class="row">
				<div th:replace="sidbar::#sbar(activeUri='main.html')"></div>

				<main  role="main" class="col-md-9 ml-sm-auto col-lg-10 pt-3 px-4">
					<div class="chartjs-size-monitor" style="position: absolute; left: 0px; top: 0px; right: 0px; bottom: 0px; overflow: hidden; pointer-events: none; visibility: hidden; z-index: -1;">
						<div class="chartjs-size-monitor-expand" style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
							<div style="position:absolute;width:1000000px;height:1000000px;left:0;top:0"></div>
						</div>
						<div class="chartjs-size-monitor-shrink" style="position:absolute;left:0;top:0;right:0;bottom:0;overflow:hidden;pointer-events:none;visibility:hidden;z-index:-1;">
							<div style="position:absolute;width:200%;height:200%;left:0; top:0"></div>
						</div>
					</div>

					<form th:if="${type=='add'}" class="form-horizontal" th:action="@{/insertStu}" method="post" style="border: 1px gray solid;width: 600px;margin:auto;margin-top: 100px;background: #c7c4ff">
						<h2 style="text-align: center">添加我的学生</h2>
                        <div class="form-group">
							<label for="StudentName" class="col-sm-2 control-label">名字：</label>
							<div class="col-sm-10">
								<input type="text" name="name" class="form-control" id="StudentName" th:required th:placeholder="学生名字">
							</div>
						</div>
						<div class="form-group">
							<label for="StudentAge" class="col-sm-2 control-label">年龄：</label>
							<div class="col-sm-10">
								<input type="text" name="age" class="form-control" id="StudentAge" th:required th:placeholder="学生年龄">
							</div>
						</div>
<!--						性别-->
						<div class="form-group" style="margin-left: 200px">
							<label>性别：</label><br/>
							<div class="form-check form-check-inline">
								<input class="form-check-input" type="radio" name="sex" value="1" checked>
								<label class="form-check-label">男</label>
							</div>
							<div class="form-check form-check-inline">
								<input class="form-check-input" type="radio" name="sex" value="2" >
								<label class="form-check-label">女</label>
							</div>
						</div>
<!--						以下拉框来输入classid-->
						<div class="col-md-7  col-md-offset-5" style="margin-left: 180px">
								<label>	班级：</label>
								<select class="col-md-6 " name="classId" shiro:lacksPermission="root">
									<option th:each="cla:${classes}" th:if="${cla.getId()!=100}" th:value="${cla.getId()}" th:text="${cla.getName()}">1</option>
								</select>
							<select class="col-md-6 " name="classId" shiro:hasPermission="root">
								<option th:each="cla:${classes1}" th:if="${cla.getId()!=100}" th:value="${cla.getId()}" th:text="${cla.getName()}">1</option>
							</select>
							</div>

						<br>
						<div class="form-group">
							<div class="col-sm-offset-2 col-sm-10" style="margin-left: 130px">
								<input type="submit" class="btn btn-default" value="添加学生"/>
                                <a th:href="@{/selStu(id=${session.teaAll.getId()})}" style="margin-left: 80px" th:text="返回"></a>
							</div>
						</div>
					</form>


					<form th:if="${type=='upd'}" class="form-horizontal" th:action="@{/updateStu}" method="post" style="border: 1px gray solid;width: 600px;margin:auto;margin-top: 100px;background: #c7c4ff">
                        <h2 style="text-align: center">更新我的学生</h2>
                        <input type="text" name="id" th:value="${student.getId()}" hidden></input>
						<div class="form-group">
							<label for="StudentName1" class="col-sm-2 control-label">名字：</label>
							<div class="col-sm-10">
								<input type="text" name="name" th:value="${student.getName()}" class="form-control" id="StudentName1" th:required th:placeholder="小红">
							</div>
						</div>
						<div class="form-group">
							<label for="StudentAge1" class="col-sm-2 control-label">年龄：</label>
							<div class="col-sm-10">
								<input type="text" name="age" th:value="${student.getAge()}" class="form-control" id="StudentAge1" th:required th:placeholder="15">
							</div>
						</div>
						<!--						性别-->
						<div class="form-group"  style="margin-left: 200px">
							<label>性别：</label><br/>
							<div class="form-check form-check-inline">
								<input class="form-check-input" type="radio" name="sex"   th:checked="${student.getSex()==1}" value="1">
								<label class="form-check-label">男</label>
							</div>
							<div class="form-check form-check-inline">
								<input class="form-check-input"  type="radio" name="sex"  th:checked="${student.getSex()==2}" value="2" >
								<label class="form-check-label">女</label>
							</div>
						</div>
						<!--						以下拉框来输入classid-->
						<div class="col-md-7  col-md-offset-5"  style="margin-left: 180px">
							<label>	班级：</label>
							<select class="col-md-6 " name="classId" >
								<option th:each="cla:${classes}" th:value="${cla.getId()}" th:selected="${cla.getId()==student.getClassId()}"  th:text="${cla.getName()}">1</option>
							</select>
						</div>

						<br>
						<div class="form-group"  style="margin-left: 150px">
							<div class="col-sm-offset-2 col-sm-10">
								<input type="submit" class="btn btn-default" value="更新学生"/>
                                <a th:href="@{/selStu(id=${session.teaAll.getId()})}" style="margin-left: 80px" th:text="返回"></a>
							</div>
						</div>
					</form>

				</main>
			</div>
		</div>


	</body>

</html>